﻿using FoodModel;
using J.FoodManageGet.Application.Command.RestaurantCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageGet.Application.CommandHandler.RestaurantCommandHandler
{
    /// <summary>
    /// 餐厅服务额度下拉框
    /// </summary>
    public class RestaurantShowCommandHandler : IRequestHandler<RestaurantShowCommand, List<RestaurantModel>>
    {
        private readonly IRestaurantRepository _restaurantRepository;

        public RestaurantShowCommandHandler(IRestaurantRepository restaurantRepository)
        {
            _restaurantRepository = restaurantRepository;
        }
        public async Task<List<RestaurantModel>> Handle(RestaurantShowCommand request, CancellationToken cancellationToken)
        {
            var list = await _restaurantRepository.RestaurantShow();
            return list;
        }
    }
}
